package com.sypk.vo.response;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson.JSON;
import com.sypk.common.util.date.DateHelper;
import com.sypk.exception.IBizException;

@SuppressWarnings("serial")
public class Response implements Serializable {
	/**
	 * 0000表示成功 -9999表示需要重新登录
	 */
	private String status;
	
	/**
	 * 非成功时错误提示信息
	 */
	private String message;
	
	/**
	 * 服务器时间，毫秒数
	 */
	private String serverTime;
	
	/**
	 * 见各接口具体返回业务参数
	 */
	private Object data;
	
	public Response() {
		super();
	}

	public Response(String status, String message) {
		super();
		this.status = status;
		this.message = message;
		this.data = JSON.toJSON(new Object());
		this.serverTime = DateHelper.DateToString(null, new Date());
	}

	public Response(Object object) {
		super();
		this.status = IBizException.success.getKey();
		this.message = IBizException.success.getMessage();
		this.data = object;
		this.serverTime = DateHelper.DateToString(null, new Date());
	}
	

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getServerTime() {
		return serverTime;
	}

	public void setServerTime(String serverTime) {
		this.serverTime = serverTime;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}


}
